package com.edu.service.impl;

import com.edu.service.BookService;

import java.util.Date;

/**
 * @Author:何包蛋
 * @Date :2022/11/2 - 11 - 02 - 14:38
 */
public class BookServicePro implements BookService {

    private BookService bs;/*目标对象作为属性*/

    public BookServicePro(BookService bs) {/*目标对象作为参数*/
        this.bs = bs;
    }

    @Override
    public void addBook() {/*对目标对象进行加强*/
        System.out.println("日志：add方法执行了"+ new Date());
        bs.addBook();
    }

    @Override
    public void getBook() {
        System.out.println("日志：getBook方法执行了"+ new Date());
        bs.getBook();
    }

    @Override
    public void updateBook() {
        System.out.println("日志：updateBook方法执行了"+ new Date());
        bs.updateBook();
    }
}
